Creating Arithmetic table is much simpler but i thought i should post my answer despite the fact there are so many answers to this question because no one talked about limit of table. Taking input from user as an integer. num = int(raw_input("Enter your number")) Set limit of table, to which extent we wish to calculate table for desired number
Share, comment, bookmark or report
Here is a function for printing a table of custom length. def multiplication_table(row, col): fin = [] for i in range(1, row+1): arr = [] for j in range(1, col+1): arr.append(i * j) fin.append(arr) return fin Ex: multiplication_table(3, 3) [[1, 2, 3], [2, 4, 6], [3, 6, 9]] Hope that helps!
Share, comment, bookmark or report
I'm learning Java and one of the task I've been given is to code a multiplication table that show like this: 1 2 3 4 5 6 7 8 9 10 // 1 2 4 6 8 10 12 14 16 18 20 // 2 ...
Share, comment, bookmark or report
This is a question from the book How to Think Like a Computer Scientist, chapter 8. This chapter covers the format method in Python. I have to print out a neat looking multiplication table like th...
Share, comment, bookmark or report
I'm having a really hard time trying to figure out this exercise. Print the 2-dimensional list mult_table by row and column. Hint: Use nested loops. Sample output for the given program: 1 | 2 | 3...
Share, comment, bookmark or report
So I'm attempting to print a multiplication table in C# however I can't quite figure out how to get what I need. So far my program outputs the following: 1 2 3 2 4 6 3 6 9 However, I need it to ...
Share, comment, bookmark or report
This function prints out a multiplication table (where each number is the result of multiplying the first number of its row by the number at the top of its column). Expected output: 1 2 3 2 4 6...
Share, comment, bookmark or report
Code: def multiplication_table(number): # Initialize the starting point of the multiplication table multiplier = 1 # Only want to loop through 5 while multiplier <= 5: result = number * multiplier # What is the additional condition to exit out of the loop?
Share, comment, bookmark or report
Trying to create a multiplication table, the for loop won’t work for some numbers. 1.
Share, comment, bookmark or report
I am basically creating a multiplication table from the user's input from 1-9. Ex. If the user inputs"3 ...
Share, comment, bookmark or report
Comments